package com.shuyuwl.core.enums;

import lombok.Getter;

/**
 * 后台管理系统状态通用
 * @author liaokx
 * @date 2019/10/21 11:00
 */
@Getter
public enum  StatusEnum {

    OK((byte)1, "启用"),
    FREEZED((byte)2, "冻结"),
    DELETE((byte)3, "删除");

    private Byte code;

    private String message;

    StatusEnum(Byte code, String message) {
        this.code = code;
        this.message = message;
    }

    public static  StatusEnum findOne(Byte status){
        for (StatusEnum value : StatusEnum.values()) {
            if(value.getCode().equals(status)){
                return value;
            }
        }
        return null;
    }
    public Byte getCode() {
        return code;
    }

    public void setCode(Byte code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
